package com.potenza.wxuser.config;

import com.potenza.wxuser.model.UserSocialInformation;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Configuration
public class DroolsConfiguration {

    @Bean
    public KieSession kieSession(){
        // 第一步
        KieServices kieServices = KieServices.Factory.get();
        // 第二步
        KieContainer kieContainer = kieServices.getKieClasspathContainer();
        // 第三步
        KieSession kieSession = kieContainer.newKieSession();
        return kieSession;
    }

    @Bean
    public KieContainer kieContainer(){
        // 第一步
        KieServices kieServices = KieServices.Factory.get();
        // 第二步
        KieContainer kieContainer = kieServices.getKieClasspathContainer();
        return kieContainer;
    }
}
